Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: fix selected track display #10394

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

theocrsb
Copy link
Contributor

@theocrsb theocrsb commented Jan 15, 2025

fix #10372
fix #10414

@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 15, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.77%. Comparing base (6b8bd15) to head (ed9bb7e).
Report is 14 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10394      +/-   ##
==========================================
- Coverage   81.80%   81.77%   -0.04%     
==========================================
  Files        1073     1055      -18     
  Lines      106605   105925     -680     
  Branches      731      730       -1     
==========================================
- Hits        87213    86616     -597     
+ Misses      19353    19270      -83     
  Partials       39       39              
Flag Coverage Δ
editoast 74.27% <ø> (-0.03%) ⬇️
front 89.35% <100.00%> (+<0.01%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@theocrsb theocrsb force-pushed the tce/front/bug-wrong-track-display branch 7 times, most recently from 6ebdd08 to 91c86cb Compare January 16, 2025 17:14
@theocrsb theocrsb marked this pull request as ready for review January 16, 2025 17:20
@theocrsb theocrsb requested a review from a team as a code owner January 16, 2025 17:20
@theocrsb theocrsb force-pushed the tce/front/bug-wrong-track-display branch from 91c86cb to aa9a0a2 Compare January 17, 2025 08:25
@RomainValls
Copy link
Contributor

Nice fix ! It also closes #10299, there were duplicates :)

pathSteps
.map((pathStep, index): MarkerProperties | null => {
const matchingOp = suggestedOP.find((op) =>
matchPathStepAndOp(pathStep as PathItemLocation, op)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this is dangerous… What is the reason why we can't replace or update MarkerInformation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just removed the cast

simulationPathSteps={markersInfo}
/>
{infraId && (
<ScenarioContextProvider infraId={infraId}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the new code require a scenario context? It seems a bit weird to use something specific to operational studies in STDCM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you suggested, I use useCachedTrackSections instead

@theocrsb theocrsb force-pushed the tce/front/bug-wrong-track-display branch from d408ed1 to b9316ab Compare January 17, 2025 11:18
@theocrsb theocrsb requested a review from SharglutDev January 20, 2025 10:46
@theocrsb theocrsb force-pushed the tce/front/bug-wrong-track-display branch 3 times, most recently from a5318cc to 27b9449 Compare January 21, 2025 06:09
@theocrsb theocrsb force-pushed the tce/front/bug-wrong-track-display branch 2 times, most recently from 731425f to b7e6857 Compare January 22, 2025 09:06
@@ -47,7 +47,9 @@ type MarkerProperties = {
type ItineraryMarkersProps = {
map: Map;
Copy link
Contributor

@SharglutDev SharglutDev Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we don't use map anymore. There are also some unused imports.

Suggested change
map: Map;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const markersInformation = useMemo(
() => extractMarkerInformation(simulationPathSteps, showStdcmAssets),
() =>
pathStepsAndSuggestedOPs &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one issue. As we don't pass this prop in stdcm, markersInformation isn't defined and there is one no marker in the stdcm maps.

@theocrsb theocrsb force-pushed the tce/front/bug-wrong-track-display branch from 31d8a6e to e4fedab Compare January 23, 2025 15:45
@theocrsb theocrsb force-pushed the tce/front/bug-wrong-track-display branch from e4fedab to ed9bb7e Compare January 23, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intinerary marker not always defined Inconsistency between the selected track and the track displayed
5 participants